---友军数量每比敌人少1个  增加 1 倍属性
---@class BuffEffect600004100:BaseBuffEffect
BuffEffect600004100 = ClientFight.CreateClass("BuffEffect600004100",ClientFight.BaseBuffEffect)
local t = BuffEffect600004100
---@param fight Fighter
---@param buff FighterBuff
function t:add(fight, buff,useAttribute)
    local add =ClientFight.BaseBuffEffect.add(self,fight, buff, false);
    self:action(fight,buff);--直接触发一次, 计算属性
    return add;
end
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...}
    local target = buff.target
    local others = FighterUtils.getOthersBy(target, true, nil,false);
    local ours = FighterUtils.getOursBy(target, true, nil,false);
    local change = #others - #ours
    if (change > 0) then
        if (buff.buffBean.f_Atribute ~= nil) then
            for k,value in pairs( buff.buffBean.f_Atribute) do
                buff.attributes.attributes[value[1]] = math.floor( value[2] * change)
                SkillRoleMgr.savePathFile(string.format("[%s][EFFECT]Fighter %s buff%s 友军数量每比敌人少1个  增加 1 倍属性, 增加倍数 %s",
                fight.frame, target.fighterId, buff.modelId,change));

            end
        end
    else
        buff.attributes.attributes = {}
    end
    ClientFight.BaseBuffEffect.action(self,fight, buff, ...);
    return IBuffEffect.SUCCESS_ATTRI_HAS_CHANGE;
end
t.New()